package com.yudongyang.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yudongyang.dao.GoodsMapper;
import com.yudongyang.domain.Goods;
import com.yudongyang.service.GoodsService;
@Service
public class GoodsServiceImpl implements GoodsService {

	@Resource
	private GoodsMapper goodsMapper;

	@Override
	public void addGoods(List<Goods> list1) {
		// TODO Auto-generated method stub
		goodsMapper.addGoods(list1);
	}

	@Override
	public PageInfo<Goods> list(Goods g, Integer pageNum, Integer pageSize) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		List<Goods> list = goodsMapper.selects(g);
		
		return new PageInfo<Goods>(list);
	}
	
}
